﻿namespace Ngs
{
    using System;

    public class Date
    {
        public Date()
        {
        }

        public Date(int year, int month, int day)
        {
            this.Year = year;
            this.Month = month;
            this.Day = day;
        }

        public int Year { get; set; }
        
        public int  Month { get; set; }

        public int Day { get; set; }

        public override string ToString()
        {
            return new DateTime(this.Year, this.Month, this.Day).ToShortDateString();
        }

        public static implicit operator Date(DateTime dateTime)
        {
            return new Date(dateTime.Year, dateTime.Month, dateTime.Day); 
        }

        public static explicit operator DateTime(Date date)
        {
            return new DateTime(date.Year, date.Month, date.Day);
        }

    }
}
